<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        Teacher.prototype.time = 5
        function Teacher(name, mSkill) {
            this.name = name
            this.mSkill= mSkill
            this.subject = '数学'
        }
        function Man(name, mSkill, age, major) {
            Teacher.call(this, name, mSkill)
            this.age = age
            this.major = major 
        }

        var tea1 = new Teacher('李四','抓手机')
        console.log(tea1)
        console.log(tea1.time)

        var man1 = new  Man('张三', '器械', 23, '健身教练')
        console.log(man1)
        console.log(man1.subject)
        console.log(man1.time)

        man1.subject = '语文'
        console.log(man1.subject)
        console.log(tea1.subject)
        
        // 我们可以发现通过call/apply的方法实现继承，通过改变this指向，可以借用其他构造函数的属性和方法，但无法访问其原型上的属性
        // 他们继承过的对象修改后互不影响
    </script>
</body>
</html>